<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>银行卡模拟</title>
    <style>
        h2 {
            text-align: center;
        }

        table {
            /* 合并相邻边框 */
            border-collapse: collapse;
            height: 80px;
            margin: 0 auto;
            text-align: center;
        }

        th {
            padding: 5px 30px;
        }

        table,
        th,
        td {
            border: 1px solid #000;
        }
    </style>
</head>

<body>
    <script>
        let money = 1000
        let shui = +prompt('请输入水费')
        let dian = +prompt('请输入电费')
        let wang = +prompt('请输入网费')
        let yue = money - (shui + dian + wang)
        document.write(`
            <table>
                <tr>
                    <th>银行卡总额</th>
                    <th>水费</th>
                    <th>电费</th>
                    <th>网费</th>
                    <th>银行卡余额</th>
                </tr>
                <tr>
                    <td>${money}元</td>
                    <td>${shui}元</td>
                    <td>${dian}元</td>
                    <td>${wang}元</td>
                    <td>${yue}元</td>
                </tr>
            </table>`)
    </script>
</body>

</html>